
:root {
    --primary--color: rgb(41, 180, 41);
    --secondary-color: #fff;
    --third-color: rgba(207, 207, 207, .2);
    --transition-time: .2s;
    --switch-width: 60px;
    --switch-height: 30px;
    --switch-slider-width: 24px;
}

.switch {
    width: var(--switch-width);
}

.switch input {
    display: none;
    border: 1px solid transparent;
}

.switch label {
    position: relative;
}

.switch label::before {
    position: absolute;
    top: 0;
    left: 0;
    content: '';
    width: var(--switch-width);
    height: var(--switch-height);
    border-radius: 15px;
    /*background: var(--third-color);*/
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .2);
    /*box-shadow: 1px 2px 8px rgba(0, 0, 0, .3);*/
    transition: var(--transition-time) ease;
}

.switch input:checked ~ label::before {
    background: var(--primary--color);
    border: none;
}

.switch label::after {
    position: absolute;
    content: '';
    width: var(--switch-slider-width);
    height: var(--switch-slider-width);
    top: calc(var(--switch-height) / 2 - var(--switch-slider-width) / 2);
    left: calc(var(--switch-height) / 2 - var(--switch-slider-width) / 2);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, .3);
    background: var(--secondary-color);
    z-index: 1;
    transition: var(--transition-time) ease;
}

.switch input:checked ~ label::after {
    left: calc(var(--switch-width) - var(--switch-height) / 2 - var(--switch-slider-width) / 2);
    background: var(--secondary-color);
}